package org.example.map;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class TestMap {
    public static void main(String[] args) {
        HashMap<Integer, String> map = new HashMap<>();
//        //一个key和一个value构成了一个Entry对象
//        map.put(1,"zhangsan");
//        map.put(2,"lisi");
//        Set<Map.Entry<Integer,String>> sets = map.entrySet();
//        for(Map.Entry<Integer,String> entry: sets){
//            System.out.println(entry);
//        }
        System.out.println(getNextNumber(58));
    }

    private static int getNextNumber(int n){
        int result = 0;
        while(n!=0) {
            int meiweisz = n%10;
            result += Math.pow(meiweisz,2);
            n=n/10;
        }
        return result;
    }
}
